# 筛选出成绩为A的同学
classes=[
    {"name":"qaz","age":15,"grade":"A"},
    {"name":"wsx","age":16,"grade":"B"},
    {"name":"edc","age":17,"grade":"A"},
    {"name":"rfv","age":18,"grade":"C"},
    {"name":"tgb","age":19,"grade":"D"},
    {"name":"yhn","age":20,"grade":"B"},
    {"name":"ujm","age":21,"grade":"A"},
]

F=filter(lambda X:True if X['grade']=="A" else False,classes)
grade_A=list(F)
print(grade_A)
# 使用map函数使得  grade_A中每个人的age加1
def func(x):
    x["age"]+=1
    return x

result = map(func, grade_A)
print(list(result))

